//
//  HMSearchView.swift
//  webo
//
//  Created by apple on 2016/11/14.
//  Copyright © 2016年 apple. All rights reserved.
//

import UIKit

//可视化属性实时刷新
@IBDesignable class HMSearchView: UIButton {
    
//    定义可视化属性
//    @IBInspectable var cornerRadius: CGFloat{
//        set{
//            layer.cornerRadius = newValue
//            self.clipsToBounds = newValue > 0
//        }
//        get{
//            return layer.cornerRadius
//        }
//    }
    
//    定义类方法
    class func loadSearchView() -> HMSearchView {
        
        let nib = UINib.init(nibName: "SearchButton", bundle: nil)
        let view = nib.instantiate(withOwner: nil, options: nil).last as! HMSearchView
     return view
    }
    
//    程序入口
    override func awakeFromNib() {
        super.awakeFromNib()
        self.imageEdgeInsets = UIEdgeInsetsMake(0, 10, 0, 10);
        self.titleEdgeInsets = UIEdgeInsetsMake(0, 15, 0, 0);
        self.bounds.size.width = UIScreen.main.bounds.size.width
//        self.addTarget(self, action: #selector(clickBtn), for: .touchUpInside)
    }

//  @objc private func clickBtn(){
//        print("ahode");
//
//    }
}
